home *** CD-ROM | disk | FTP | other *** search
-
-
-
- GETWD(3) MINTLIB LIBRARY FUNCTIONS GETWD(3)
-
-
- N✓NA✓AM✓ME✓E
- getwd, getcwd - get path-name of current working directory
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- #include <unistd.h>
-
- char *getwd(char *buf);
-
- char *getcwd(char *buf, int size);
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- getcwd returns a pointer to the current directory path
- name. The value of size is the maximum length of the name
- to be returned. If buf is a NULL pointer, getcwd will
- obtain size bytes of space using malloc. It is up to the
- calling process to free this buffer.
-
- getwd is equivalent to getcwd(buf, PATH_MAX). Since
- PATH_MAX is the length of the longest path name allowed,
- this buffer should always be sufficient. Still, the use of
- this function is discouraged, since it is not specified in
- POSIX and may therefore be unavailable on other systems.
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- c✓ch✓hd✓di✓ir✓r(✓(3✓3)✓),✓, m✓ma✓al✓ll✓lo✓oc✓c(✓(3✓3)✓),✓, D✓Dg✓ge✓et✓tc✓cw✓wd✓d(✓(2✓2)✓),✓, D✓Dg✓ge✓et✓td✓dr✓rv✓v(✓(2✓2)✓),✓, D✓Dg✓ge✓et✓tp✓pa✓at✓th✓h(✓(2✓2)✓)
-
- R✓RE✓ET✓TU✓UR✓RN✓N V✓VA✓AL✓LU✓UE✓ES✓S
- These functions return NULL is buf is NULL and no memory
- could be allocated; otherwise, a pointer to buf is
- returned.
-
-
- N✓NO✓OT✓TE✓ES✓S
- On TOS and MiNT before 0.96, the size parameter to getcwd
- is only used for allocating memory; this functions are not
- yet safe, i.e. buf may overflow.
-
- On UN*X System V.3, the getcwd function was implemented
- using popen() and the pwd command! There had to be a bet-
- ter way...
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MiNT docs 0.1 3 March 1993 1
-
-
-